<?php
namespace app\mini\model;

use think\facade\Db;
use app\common\traits\ActionRecordTrait;
use think\Model;
use app\admin\controller\ApiCommon;

use app\crm\model\CustomerLossModel;
use app\crm\model\OrderStatistics;
use app\admin\model\ShopOrderModel;
use app\admin\model\CustomerModel;
use app\admin\model\ShopModel;
use app\shop\model\Refund as OrderModel;
use app\mini\model\MiniStisticsModel;



class SendUrlModel extends Model

{



    /**

     * @var string

     */

    protected $name = 'admin_sys';



    protected $defaultSoftDelete = 0;



    protected $autoWriteTimestamp = true;

    

    /**

     * 发送请求函数

     * @return array

     * @author ran

     * @date 2021-09-23 13:53

     * mailbox 466180170@qq.com

     */

    public function send_url($url,$jsonData)
    {
        // 请求函数 参数($url,$jsonData)
        $ch = curl_init();
	    curl_setopt($ch, CURLOPT_POST, 1);
	    curl_setopt($ch, CURLOPT_URL, $url);
	    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	    // https 支持 - 对认证证书来源的检查
	    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	    // 请求数据放这里
	    curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
	    // head
	    // curl_setopt($ch, CURLOPT_HTTPHEADER, $head);

        $response = curl_exec($ch);

        return $response;

    }

    

}